<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue"></script>
    <script>
        window.onload=function() {
            var app4 = new Vue({
                el: '#app-4',
                methods: {
                    reverseMessage: function () {
                        this.message = this.message.split('').reverse().join('')
                    },
                    addpeoole: function () {
                        this.people.push({name:'王者',age:19})
                    }
                },
                data: {   message:'Hellow Vue.js!',
                    addpeople: [
                        { name: '王者',age:'18' },
                        { name: ' 英雄',age:'20'},


                    ]
                }
            })
        }
    </script>
</head>
<body>

<div id="app-4">
    <p>{{ message }}</p>
    <button v-on:click="addpeople">添加</button>
    <table border="1">
        <tr>
            <th>名字</th><th>年龄</th>
        </tr>
        <tr v-for="todo in addpeople">
            <td>{{todo.name}}</td>
            <td>{{todo.age}}</td>
        </tr>
    </table>

</body>
</html>